﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace AdminLogin.AdminLogin
{
    public class CheckLoginInfor
    {

        public int validating(string str1, string str2)
        {
            ConnectUserDataBase loginuse = new ConnectUserDataBase();
            DataTable table = new DataTable();
            table = loginuse.laydulieu();

            if (str1 == "admin" && str2 == "adminstrator")
            {
                return 2;
            }


            foreach (DataRow row in table.Rows)
            {
                if (((row[0].ToString()).CompareTo(str1) == 0) && ((row[1].ToString()).CompareTo(str2) == 0))
                {
                    return 1;

                }
            }
            return 0;


        }
    }
}